Repository navigation
fix(tools): resolve hermes CLI beside the interpreter in bot_mode_dm deliveries - #100673
liuhao1024 wants to merge 1 commit into
Conversation
|
The sole failing check here is Desktop E2E / Playwright E2E (Linux) (the "All required checks pass" aggregate fails for the same root cause). This looks like a pre-existing flake on
Given the same fingerprint reproduces on clean |
|
Independent confirmation of #100662 on a different install shape, plus one extra failure mode this PR also covers:
One suggestion: if the new test only pins the local-teammate transport, a symmetric assertion for the peer-dm argv ( |
|
Thanks for the independent confirmation and the extra failure mode — good to know the wrong- On the test suggestion: the symmetric peer-dm assertion is already covered in this PR. |
…deliveries Bot-to-bot message_agent delivery builds both transport argvs (local teammate chat and peer dm) with a bare "hermes" as argv[0]. Since NousResearch#96631 the delivery runner spawns under terminal_tool's isolated host-local environment, which does not inherit the gateway's PATH — so on docker/service installs (venv at /opt/hermes/.venv) every delivery exits with FileNotFoundError: 'hermes'. Resolve the CLI with bot_relay._hermes_cli() (NousResearch#93590) — the venv sibling of this interpreter, then shutil.which, then the bare name — at both argv construction sites. The turn-lock matcher in _delivery_lock() already matches argv[0] by basename, so absolute paths lock exactly as before. Fixes NousResearch#100662
35f9249 to
1b30ccb
Compare
|
Thanks @liuhao1024. Your fix was carried with contributor history into #111298, now merged at b8bf484. We independently reproduced the failure and verified the repair in native Electron with real Hermes backends. Closing this original as landed through the salvage. |
What does this PR do?
Bot-to-bot
message_agentdelivery builds both transport argvs — the local-teammatehermes -p <bot> chat …turn and the peerhermes -p <default> peer dm …transport — with a bare"hermes"as argv[0]. Since #96631 the delivery runner spawns viaterminal_tool(..., _host_local=True), which uses an isolated host-local environment cache that does not inherit the gateway's PATH. On docker/service installs (venv at/opt/hermes/.venv, nohermeson the runner's minimal PATH) every delivery therefore acksstatus: queuedand then the background runner exits 1 withFileNotFoundError: [Errno 2] No such file or directory: 'hermes'(#100662).This PR resolves the CLI at both argv construction sites in
tools/bot_mode_dm.pyusingbot_relay._hermes_cli()— the exact resolver the relay's deliver RPC adopted for the same class of failure in #93590 (venv sibling of this gateway's interpreter →shutil.which→ bare-name fallback). The runner is spawned with the gateway's ownsys.executable, so the sibling lookup is correct in the runner's context too. The turn-lock matcher in_delivery_lock()already matches argv[0] by basename (see its comment referencing #93590), so resolved absolute paths — andhermes.exeon Windows — take the per-profile lock exactly as before.Related Issue
Fixes #100662
Type of Change
Changes Made
tools/bot_mode_dm.py: resolve the delivery CLI viabot_relay._hermes_cli()inmessage_agent_tooland use it for both argv construction sites (peer dm and local teammate chat) instead of the bare"hermes".tests/tools/test_bot_mode_dm.py: existing transport-argv assertions now expect_hermes_cli()as argv[0] — they previously pinned the bare name, i.e. they encoded the buggy behavior; addedtest_delivery_resolves_venv_sibling_cli, which fakes a docker-style venv (no PATH hit, sibling entrypoint besidesys.executable) and asserts both transports carry the absolute sibling path.How to Test
python -m pytest tests/tools/test_bot_mode_dm.py tests/tools/test_bot_relay_windows_paths.py tests/tools/test_bot_turn_lock.py tests/tools/test_bot_retry_policy.py tests/tools/test_bot_dm_payload_cache.py tests/tools/test_bot_mode_probe.py tests/tools/test_bot_relay.py tests/hermes_cli/test_chat_query_file.py -q→ Observed result: 148 passed, 1 skipped (includes the new regression test).sys.executableto a fake venv with ahermessibling and no PATH resolution — both the local and peer transports now embed the absolute sibling path (new test), where before this PR they embedded barehermesand died with ENOENT under the isolated runner env.test_bot_relay_windows_paths.pysuite (sibling →shutil.which→ bare name).Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/Ahermes.exe, lock matcher splits on both separators)